<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
      <h1>我是标题<span class="s"></span></h1>
      <input type="text" id="i1">
      <input type="text" id="i2">
      <button onclick="f1()">按钮</button>
      <script>
        function f1(){
          let inputE1 = document.querySelector('#i1');
          console.log(inputE1);
          var x=inputE1.value;
          console.log(x,typeof x);

          // console.log(parseFloat(x))//输出的结果是string类型，需要转换

        }
        let spanE =document.querySelector('.s');
        console.log(spanE);

        let inputE1 = document.querySelector('#i1');
        console.log(inputE1);

        let inputE2 = document.getElementById('i2');
        console.log(inputE2);
      </script>

    </body>
</html>